﻿/// <reference path="UserModel.js" />
function taskModel(serverTaskModel) {
    var self = this;

    self.id = serverTaskModel != null ? ko.observable(serverTaskModel.Id) : ko.observable('unknown');
    self.description = serverTaskModel != null ? ko.observable(serverTaskModel.Description) : ko.observable('unknown');
    self.creationTime = serverTaskModel != null ? ko.observable(serverTaskModel.CreationTime) : ko.observable('unknown');
    self.dueDate = serverTaskModel != null ? ko.observable(serverTaskModel.DueDate) : ko.observable('unknown');
    self.originator = serverTaskModel != null ? ko.observable(new userModel(serverTaskModel.Originator)) : ko.observable('unknown');

    return (serverTaskModel != null) ? self : 'unknown';
}